package com.sjgs.gis.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

import static com.sjgs.common.Constants.DEFAULT_DATE_TIME_FORMAT;

@Builder
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
@Data
public class KVDatabase implements Serializable {
    private static final long serialVersionUID = 1L;
    String dbName;
    String owner;
    @DateTimeFormat(pattern = DEFAULT_DATE_TIME_FORMAT)
    @JsonFormat(pattern = DEFAULT_DATE_TIME_FORMAT)
    LocalDateTime createTime = LocalDateTime.now();

    public KVDatabase(String dbName, String owner) {
        this.dbName = dbName;
        this.owner = owner;
    }
}
